package com.qls.web.modules.op.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qls.core.entity.OpHtlGroup;
import com.qls.web.common.utils.PageUtils;
import com.qls.web.common.utils.Query;
import com.qls.web.modules.op.dao.HtlGroupDao;
import com.qls.web.modules.op.service.HtlGroupService;
import com.qls.web.modules.vo.HotelVO;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


/**
 * @author doyoung
 */
@Service("htlGroupService")
public class HtlGroupServiceImpl extends ServiceImpl<HtlGroupDao, OpHtlGroup> implements HtlGroupService {

    @Override
    public List<Long> getHotelIdByStoreId(Long storeId) {
        return baseMapper.getHotelIdByStoreId(storeId);
    }

    @Override
    public List<Long> getHotelIdByGroupId(Integer groupId) {
        return baseMapper.getHotelIdByGroupId(groupId);
    }

    @Override
    public PageUtils sqlQueryPage(Map<String, Object> params) {
        IPage<HotelVO> page = new Query<HotelVO>().getPage(params);
        params.put("page", page);
        List<HotelVO> list = baseMapper.sqlQueryPage(params);
        return new PageUtils(page, list);
    }

    @Override
    public Long sqlQueryByGroupId(Integer id) {
        return baseMapper.sqlQueryByGroupId(id);
    }
}